package laboratoryQ.experiment.ui;

import java.awt.*;

import javax.swing.*;

import laboratoryQ.ui.draw.style.ChainStylizerStylizer;
import laboratoryQ.ui.draw.style.IStylizer;
import laboratoryQ.ui.draw.style.PaintDiaItem;

public class UIUtils {
	public static final Color[] COLORS_COLLECTION = new Color[] {
		Color.RED,
		Color.GREEN,
		Color.BLUE,
		new Color(150, 150, 0),
		Color.ORANGE,
		Color.YELLOW,
		Color.CYAN,
		Color.MAGENTA,
		Color.PINK,
		Color.DARK_GRAY,
	};

	public static GridBagConstraints getDefaultGBC() {
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.fill = GridBagConstraints.BOTH;
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.gridheight = 1;
		gbc.gridwidth = 1;
		gbc.weightx = 1.0;
		gbc.weighty = 1.0;
		return gbc;
	}

	public static JFrame configureSingleComponentFrame(JComponent panel) {
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		frame.getContentPane().add(panel);
		return frame;
	}

	public static IStylizer configureDefaultUIStylizer() {
		ChainStylizerStylizer stylizer = new ChainStylizerStylizer();
		
		IStylizer paintDiaItem = new PaintDiaItem();
		stylizer.addStage(paintDiaItem);
		
		return stylizer;
	}

//	public static List<Color> colorsList(Color[] colors, int count) {
//		List<Color> list = new ArrayList<Color>();
//		for (int i = 0; i < count; i++) {
//			list.add(colors[i % colors.length]);
//		}
//		return list;
//	}
//	
//	public static ICoordinateTransformer generateEasyUITransformer(int boardSize, RangeInfo rangeInfo) {
//		return generateEasyUITransformer(boardSize, rangeInfo, true);
//	}
//	
//	public static ICoordinateTransformer generateEasyUITransformer(int boardSize, RangeInfo rangeInfo, boolean commonScaleMult) {
//		BoardTransformer boardTransformer = new BoardTransformer(
//		boardSize,
//		rangeInfo,
//		commonScaleMult
//		);
//		RevertYTransformer revertYTransformer = new RevertYTransformer();
//		return new MultiTransformer(boardTransformer, revertYTransformer);
//	}
}
